home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu017.dms / pu017.adf / Screens / Example2.c < prev    next >
C/C++ Source or Header  |  1990-01-30  |  3KB  |  86 lines

  1. /* Example2                                                              */
  2. /* This program will open a high-resolution, Interlaced, four colour     */
  3. /* Custom Screen. It will display it for 30 secondes, and then close it. */
  4.  
  5.  
  6.  
  7. /* If your program is using Intuition you should include intuition.h: */
  8. #include <intuition/intuition.h>
  9.  
  10. /* Since we are using an interlaced display (ViewModes = INTERLACE) we */
  11. /* need to include the headerfile "display.h" which declares the       */
  12. /* constant "INTERLACE".                                               */
  13. #include <graphics/display.h>
  14.  
  15.  
  16.  
  17. struct IntuitionBase *IntuitionBase;
  18.  
  19.  
  20.  
  21. /* Declare a pointer to a Screen structure: */ 
  22. struct Screen *my_screen;
  23.  
  24. /* Declare and initialize your NewScreen structure: */
  25. struct NewScreen my_new_screen=
  26. {
  27.   0,               /* LeftEdge  Should always be 0. */
  28.   0,               /* TopEdge   Top of the display.*/
  29.   640,             /* Width     We are using a high-resolution screen. */
  30.   400,             /* Height    Interlaced NTSC (American) display. */
  31.   2,               /* Depth     4 colours. */
  32.   0,               /* DetailPen Text should be drawn with colour reg. 0 */
  33.   1,               /* BlockPen  Blocks should be drawn with colour reg. 1 */
  34.   HIRES|INTERLACE, /* ViewModes High-resolution, Interlaced */
  35.   CUSTOMSCREEN,    /* Type      Your own customized screen. */
  36.   NULL,            /* Font      Default font. */
  37.   "MY SCREEN",     /* Title     The screen' title. */
  38.   NULL,            /* Gadget    Must for the moment be NULL. */
  39.   NULL             /* BitMap    No special CustomBitMap. */
  40. };
  41.  
  42.  
  43.  
  44. main()
  45. {
  46.   /* Open the Intuition Library: */
  47.   IntuitionBase = (struct IntuitionBase *)
  48.     OpenLibrary( "intuition.library", 0 );
  49.   
  50.   if( IntuitionBase == NULL )
  51.     exit(); /* Could NOT open the Intuition Library! */
  52.   
  53.  
  54.  
  55.   /* We will now try to open the screen: */
  56.   my_screen = (struct Screen *) OpenScreen( &my_new_screen );
  57.   
  58.   /* Have we opened the screen succesfully? */
  59.   if(my_screen == NULL)
  60.   {
  61.     /* Could NOT open the Screen! */
  62.     
  63.     /* Close the Intuition Library since we have opened it: */
  64.     CloseLibrary( IntuitionBase );
  65.  
  66.     exit();  
  67.   }
  68.  
  69.  
  70.  
  71.   /* We have opened the screen, and everything seems to be OK. */
  72.   /* Wait for 30 seconds: */
  73.   Delay( 50 * 30);
  74.  
  75.  
  76.  
  77.   /* We should always close the screens we have opened before we leave: */
  78.   CloseScreen( my_screen );
  79.  
  80.  
  81.   
  82.   /* Close the Intuition Library since we have opened it: */
  83.   CloseLibrary( IntuitionBase );
  84.   
  85.   /* THE END */
  86. }